﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _26_Flyweight
{
    class Program
    {
        /*
         【享元模式(Flyweight)】:运用共享技术有效地支持大量细粒度的对象。
          
          
             */
        static void Main(string[] args)
        {
            int extrinsicstate = 22;

            FlyweightFactory f = new FlyweightFactory();

            Flyweight fx = f.GetFlyweight("X");
            fx.Opetation(--extrinsicstate);

            Flyweight fy = f.GetFlyweight("Y");
            fy.Opetation(--extrinsicstate);

            Flyweight fz = f.GetFlyweight("Z");
            fz.Opetation(--extrinsicstate);
            UnSharedConcreteFlyweight uf = new UnSharedConcreteFlyweight();

            uf.Opetation(--extrinsicstate);

            Console.Read()
;        }
    }
}
